package collectionexercise;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;

public class GenericDemo {
    public static void main(String[] args) {
        Collection<Point> c =new ArrayList<>();
        c.add(new Point(12,56));
        c.add(new Point(12654,564));
        c.add(new Point(0,0));
        c.add(new Point(0,0));
        c.add(new Point(0,0));
        c.add(new Point(1,3));
        System.out.println(c);
        Iterator<Point> it = c.iterator();
        while (it.hasNext()){
            Point str = it.next();
            if((new Point(0,0)).equals(str)){
                it.remove();
            }
            System.out.println(str);
        }
        System.out.println(c);
    }
}
